Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Parse SVG files and render them as PNG, PDF, SVG, or raw memory buffer images.
LibRSVG is a SVG rendering library, which parses SVG files and renders them in various formats. The formats include:
Here is a simple example. Look in index.js
for more documentation.
var Rsvg = require('rsvg').Rsvg;
var fs = require('fs');
// Create SVG render instance.
var svg = new Rsvg();
// When finishing reading SVG, render and save as PNG image.
svg.on('finish', function() {
console.log('SVG width: ' + svg.width);
console.log('SVG height: ' + svg.height);
fs.writeFile('tiger.png', svg.render({
format: 'png',
width: 600,
height: 400
}).data);
});
// Stream SVG file into render instance.
fs.createReadStream('tiger.svg').pipe(svg);
First install the LibRSVG library and header files. Usually you have to look for a development package version. You must also have a functioning build tool chain including pkg-config
. You can find instructions for different operating systems below. After that, you simply run:
npm install rsvg
Library versions known to work:
sudo apt-get install librsvg2-dev
sudo yum install librsvg2-devel
brew install librsvg
If, after installing LibRSVG through homebrew you are experiencing issues installing this module, try manually exporting the package config with this command:
export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig
Then try reinstalling this module. For further information, see this thread.
N/A; pull requests are accepted!
FAQs
Parse SVG files and render them as PNG, PDF, SVG, or raw memory buffer images.
The npm package rsvg receives a total of 6 weekly downloads. As such, rsvg popularity was classified as not popular.
We found that rsvg demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.